<!DOCTYPE html>
<html>
<head>
    <title>激活码生成</title>
    <#include "/header.html">
</head>
<body>

<form class="form-horizontal" role="form" id="form-k">
    <div class="form-group">
        <label for="overtime" class="col-sm-2 control-label">过期时间</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="overtime" placeholder="请输入过期时间">
        </div>
    </div>
    <div class="form-group">
        <label for="actcode" class="col-sm-2 control-label">激活码</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="actcode">
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-3 col-sm-10">
            <button  class="btn btn-default" id="generate">生成激活码</button>
        </div>
    </div>
</form>


<script>

    $("#generate").click(function () {
        var overtime=$("#overtime").val();
        $.ajax({
            async : true,
            dataType : "json",
            contentType: "json",
            url: "/sys/actCode/generate?data="+overtime, success: function (result) {
                console.log(result.actCode);
                $("#actcode").attr("value",result.actCode);//填充内容
            }
        });
    });

</script>


</body>
</html>